package com.hxkj.domain.enums;

import com.platform.common.domain.exception.CustomExceptionCode;

/**
 * 合作公司异常枚举
 * <p>
 * Created by yaosy on 2018年6月13日21:01:45
 */
public enum CompanyInfoExceptionEnum implements CustomExceptionCode {

    COMPANY_INFO_EXCEPTION_NOT_ID(600, "公司管理id为空", 900),
    COMPANY_INFO_EDIT_FAILED(601, "修改公司管理失败", 900),
    COMPANY_INFO_NAME_NOT_BLANK(602, "公司管理名称不能为空！", 900),
    COMPANY_INFO_LOGO_NOT_BLANK(603, "公司管理LOGO不能为空！", 900),
    COMPANY_INFO_BIEF_NOT_BLANK(604, "公司管理标识不能为空！", 900),
    COMPANY_INFO_DETAILS_NOT_BLANK(605, "公司管理详情不能为空！", 900),
    COMPANY_INFO_ONLINE_NOT_BLANK(606, "上线时间不能为空！", 900),
    COMPANY_INFO_ADDRESS_NOT_BLANK(607, "注册地址不能为空！", 900),
    COMPANY_INFO_CAPTIAL_NOT_BLANK(608, "注册资本不能为空！", 900),
    COMPANY_INFO_INCOME_RAGE_NOT_BLANK(609, "注册资本不能为空！", 900),
    COMPANY_INFO_PHONE_NOT_BLANK(610, "公司电话不能为空！", 900),
    COMPANY_INFO_CODE_NOT_BLANK(611, "公司企业执照代码不能为空！", 900),
    COMPANY_INFO_PERSON_NOT_BLANK(612, "公司法人不能为空！", 900),
    COMPANY_INFO_CONTACTS_PERSON_NOT_BLANK(613, "公司联系人不能为空！", 900),
    COMPANY_INFO_ICP_RECORD_NOT_BLANK(614, "icp备案号不能为空！", 900),
    COMPANY_INFO_SAVE_FAILED(615, "保存公司管理失败", 900),
    COMPANY_INFO_EXISTS_FAILED(616, "已存在公司管理名称", 900),
    COMPANY_INFO_DELETE_FAILED(617, "删除公司管理名称", 900),
    COMPANY_INFO_PROFILE_FAILED(618, "公司简介不能为空", 900),
    COMPANY_INFO_STATUS_FAILED(619, "状态不能为空", 900),



    ;
    private Integer code;
    private String msg;
    private Integer httpCode;

    CompanyInfoExceptionEnum(Integer code, String msg, Integer httpCode) {
        this.code = code;
        this.msg = msg;
        this.httpCode = httpCode;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getHttpCode() {
        return httpCode;
    }

    @Override
    public void setHttpCode(Integer httpCode) {
        this.httpCode = httpCode;
    }


    public static CompanyInfoExceptionEnum getEnumByCode(Integer code){
        for(CompanyInfoExceptionEnum siteExceptionEnum : CompanyInfoExceptionEnum.values()){
            if(code.equals(siteExceptionEnum.getCode())){
                return siteExceptionEnum;
            }
        }
        return null;
    }
}
